package com.java.base.exercise;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.xml.BeanDefinitionDocumentReader;
import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;
import org.springframework.util.StringUtils;

import java.util.*;
import java.util.stream.Collectors;

/**
 * @Author RenPu
 * @Date 2021/8/25 17:50
 * @Version 1.0
 * @Description:
 **/
public abstract class PeopleTest {

   private Class<?> documentReaderClass = String.class;

    public static void main(String[] args) {

        HashMap<String, Object> map = new HashMap<>();
        map.getOrDefault("mian","");

//
//        List<People> peopleList = null;
//
//
//        List<Integer> collect = peopleList.stream().map(People::getAge).collect(Collectors.toList());

//        String cast = String.class.cast(BeanUtils.instantiateClass(this.documentReaderClass));
//        System.out.println("打印结果为===:========"+cast);

        List<String> list=new ArrayList<String>();
        list.add("111");

        String MULTI_VALUE_ATTRIBUTE_DELIMITERS = ",; ";
        String id = "user";
        String nameAttr = "zhang;san";
        if (StringUtils.hasLength(nameAttr)) {
            String[] nameArr = StringUtils.tokenizeToStringArray(nameAttr, MULTI_VALUE_ATTRIBUTE_DELIMITERS);
            System.out.println(Arrays.asList(nameArr));
        }

        List<String> aliases = new ArrayList<String>();
        boolean add = aliases.add("1111");
        String remove = aliases.remove(0);
        boolean empty = aliases.isEmpty();

        System.out.println("剔除数据得结果：======="+remove+"=====================判断集合结果未======"+empty);




        boolean result=StringUtils.hasText("hello world in the wwwwww");
        System.out.println("响应得结果只未："+result);
        if (!StringUtils.hasText("hello world in the wwwwww")) {
            System.out.println("进入到正常逻辑......");

        }else {
            System.out.println("未进入到循环体内部");
        }


        boolean hasListRest = hasList(list);
        System.out.println("集合判定结果为："+hasListRest);


        List<String> arrayList = new ArrayList<>();

        Collections.addAll(arrayList,"orderId","orderNumber","orderType","aggregateAmount","paymentIntegral",
                "actualAmount","paymentTypeStr","orderAccount","orderCreateTime",
                "statusStr","auditingStatusStr","auditingTime","enterpriseCode",
                "enterpriseName","memberLevel","provinceName","cityName",
                "districtName","address","remark","buyerMessage","goodsCode","goodsName",
                "brandName","quantity","shipQuantity","breakQuantity","price",
                "couponPrice","warehouse","warehouseName");

        System.out.println("======== 一次性存入多个值  ======"+arrayList);

    }




    public static boolean hasList(List<?> nameAttr) {
        return !nameAttr.isEmpty();
    }

}
